"""
Enumerate every component file dependency for GuestOS
"""

component_files = {
    # environment
    Label("guestos/environment/90-sev-status.sh"): "/etc/systemd/system-environment-generators/90-sev-status.sh",

    # early-boot
    Label("early-boot/relabel-machine-id/relabel-machine-id-guestos.sh"): "/opt/ic/bin/relabel-machine-id.sh",
    Label("early-boot/relabel-machine-id/relabel-machine-id.service"): "/etc/systemd/system/relabel-machine-id.service",
    Label("early-boot/setup-hostname/setup-hostname.sh"): "/opt/ic/bin/setup-hostname.sh",
    Label("early-boot/setup-hostname/guestos/setup-hostname.service"): "/etc/systemd/system/setup-hostname.service",
    Label("early-boot/setup-hostname/hostname-empty"): "/etc/hostname",
    Label("early-boot/save-machine-id/save-machine-id.sh"): "/opt/ic/bin/save-machine-id.sh",
    Label("early-boot/save-machine-id/save-machine-id.service"): "/etc/systemd/system/save-machine-id.service",
    Label("early-boot/fstab/fstab-guestos"): "/etc/fstab",
    Label("early-boot/locale"): "/etc/default/locale",
    Label("early-boot/initramfs-tools/guestos/amd64-microcode"): "/etc/default/amd64-microcode",
    Label("early-boot/initramfs-tools/guestos/intel-microcode"): "/etc/default/intel-microcode",
    Label("early-boot/initramfs-tools/guestos/hooks/veritysetup"): "/etc/initramfs-tools/hooks/veritysetup",
    Label("early-boot/initramfs-tools/guestos/initramfs.conf"): "/etc/initramfs-tools/initramfs.conf",
    Label("early-boot/initramfs-tools/guestos/modules"): "/etc/initramfs-tools/modules",
    Label("early-boot/initramfs-tools/guestos/scripts/init-bottom/set-machine-id"): "/etc/initramfs-tools/scripts/init-bottom/set-machine-id",
    Label("early-boot/initramfs-tools/guestos/scripts/init-premount/verity-root"): "/etc/initramfs-tools/scripts/init-premount/verity-root",

    # ic
    Label("guestos/ic-btc-adapter/generate-btc-adapter-config.sh"): "/opt/ic/bin/generate-btc-adapter-config.sh",
    Label("guestos/ic-btc-adapter/generate-doge-adapter-config.sh"): "/opt/ic/bin/generate-doge-adapter-config.sh",
    Label("guestos/ic-btc-adapter/ic-btc-mainnet-adapter.service"): "/etc/systemd/system/ic-btc-mainnet-adapter.service",
    Label("guestos/ic-btc-adapter/ic-btc-mainnet-adapter.socket"): "/etc/systemd/system/ic-btc-mainnet-adapter.socket",
    Label("guestos/ic-btc-adapter/ic-btc-testnet-adapter.service"): "/etc/systemd/system/ic-btc-testnet-adapter.service",
    Label("guestos/ic-btc-adapter/ic-btc-testnet-adapter.socket"): "/etc/systemd/system/ic-btc-testnet-adapter.socket",
    Label("guestos/ic-btc-adapter/ic-doge-mainnet-adapter.service"): "/etc/systemd/system/ic-doge-mainnet-adapter.service",
    Label("guestos/ic-btc-adapter/ic-doge-mainnet-adapter.socket"): "/etc/systemd/system/ic-doge-mainnet-adapter.socket",
    Label("guestos/ic-btc-adapter/ic-doge-testnet-adapter.service"): "/etc/systemd/system/ic-doge-testnet-adapter.service",
    Label("guestos/ic-btc-adapter/ic-doge-testnet-adapter.socket"): "/etc/systemd/system/ic-doge-testnet-adapter.socket",
    Label("guestos/setup-permissions/setup-permissions.sh"): "/opt/ic/bin/setup-permissions.sh",
    Label("guestos/setup-permissions/setup-permissions.service"): "/etc/systemd/system/setup-permissions.service",
    Label("guestos/setup-permissions/erestorecon.sh"): "/opt/ic/bin/erestorecon.sh",
    Label("guestos/share/ark.pem"): "/opt/ic/share/ark.pem",
    Label("guestos/ic-crypto-csp/ic-crypto-csp.service"): "/etc/systemd/system/ic-crypto-csp.service",
    Label("guestos/ic-crypto-csp/ic-crypto-csp.socket"): "/etc/systemd/system/ic-crypto-csp.socket",
    Label("guestos/ic-https-outcalls-adapter/ic-https-outcalls-adapter.service"): "/etc/systemd/system/ic-https-outcalls-adapter.service",
    Label("guestos/ic-https-outcalls-adapter/ic-https-outcalls-adapter.socket"): "/etc/systemd/system/ic-https-outcalls-adapter.socket",
    Label("guestos/ic-https-outcalls-adapter/generate-https-outcalls-adapter-config.sh"): "/opt/ic/bin/generate-https-outcalls-adapter-config.sh",
    Label("guestos/ic-replica.service"): "/etc/systemd/system/ic-replica.service",
    Label("guestos/remote-attestation-server.service"): "/etc/systemd/system/remote-attestation-server.service",
    Label("guestos/generate-ic-config/generate-ic-config.service"): "/etc/systemd/system/generate-ic-config.service",
    Label("guestos/share/ic-boundary.env"): "/opt/ic/share/ic-boundary.env",
    Label("guestos/share/nns_public_key.pem"): "/opt/ic/share/nns_public_key.pem",

    # init
    Label("guestos/init/bootstrap-ic-node/bootstrap-ic-node.service"): "/etc/systemd/system/bootstrap-ic-node.service",
    Label("guestos/init/mount-config/maybe-disable-store-mounts.service"): "/etc/systemd/system/maybe-disable-store-mounts.service",
    Label("guestos/init/init-config/init-config.sh"): "/opt/ic/bin/init-config.sh",
    Label("guestos/init/init-config/init-config.service"): "/etc/systemd/system/init-config.service",
    Label("guestos/init/setup-encryption/setup-data-encryption.sh"): "/opt/ic/bin/setup-data-encryption.sh",
    Label("guestos/init/setup-encryption/setup-data-encryption.service"): "/etc/systemd/system/setup-data-encryption.service",
    Label("guestos/init/setup-encryption/setup-var-encryption.sh"): "/opt/ic/bin/setup-var-encryption.sh",
    Label("guestos/init/setup-encryption/override.conf"): "/etc/systemd/system/systemd-fsck@dev-mapper-var_crypt.service.d/override.conf",
    Label("guestos/init/setup-lvs/setup-lvs.service"): "/etc/systemd/system/setup-lvs.service",
    Label("guestos/init/setup-lvs/setup-lvs.sh"): "/opt/ic/bin/setup-lvs.sh",
    Label("guestos/init/cleanup-config-bootstrap/cleanup-config-bootstrap.service"): "/etc/systemd/system/cleanup-config-bootstrap.service",

    # misc
    Label("misc/config/config-guestos.sh"): "/opt/ic/bin/config.sh",
    Label("misc/logging.sh"): "/opt/ic/bin/logging.sh",
    Label("misc/metrics.sh"): "/opt/ic/bin/metrics.sh",
    Label("misc/chrony/chrony.conf"): "/etc/chrony/chrony.conf",
    Label("misc/chrony/chrony-var.service"): "/etc/systemd/system/chrony-var.service",
    Label("misc/vsock/10-vhost-vsock.rules"): "/etc/udev/rules.d/10-vhost-vsock.rules",
    Label("misc/sev/99-sev.rules"): "/etc/udev/rules.d/99-sev.rules",
    Label("guestos/misc/ic-node.conf"): "/etc/tmpfiles.d/ic-node.conf",
    Label("guestos/misc/sudoers"): "/etc/sudoers",
    Label("guestos/misc/crypttab"): "/etc/crypttab",
    Label("guestos/misc/sysctl.d/dfn-max-map-count.conf"): "/etc/sysctl.d/dfn-max-map-count.conf",
    Label("guestos/misc/sysctl.d/privileged-ports.conf"): "/etc/sysctl.d/privileged-ports.conf",
    Label("guestos/misc/sysfs.d/hugepage.conf"): "/etc/sysfs.d/hugepage.conf",
    Label("guestos/misc/hsm/pcscd"): "/etc/default/pcscd",
    Label("misc/log-config/log-config-guestos.service"): "/etc/systemd/system/log-config.service",
    Label("misc/log-config/log-config.sh"): "/opt/ic/bin/log-config.sh",
    Label("guestos/misc/sync_fstrim.sh"): "/opt/ic/bin/sync_fstrim.sh",
    Label("misc/systemd-user/user@.service"): "/etc/systemd/system/user@.service",
    Label("guestos/guest-upgrade-client/guest-upgrade-client.service"): "/etc/systemd/system/guest-upgrade-client.service",

    # monitoring
    Label("monitoring/guestos/ipv4-connectivity-check/ipv4-connectivity-check.sh"): "/opt/ic/bin/ipv4-connectivity-check.sh",
    Label("monitoring/guestos/ipv4-connectivity-check/ipv4-connectivity-check.service"): "/etc/systemd/system/ipv4-connectivity-check.service",
    Label("monitoring/guestos/ipv4-connectivity-check/ipv4-connectivity-check.timer"): "/etc/systemd/system/ipv4-connectivity-check.timer",
    Label("monitoring/guestos/fstrim/fstrim_tool.service"): "/etc/systemd/system/fstrim_tool.service",
    Label("monitoring/guestos/fstrim/fstrim_tool.timer"): "/etc/systemd/system/fstrim_tool.timer",
    Label("monitoring/guestos/fstrim/setup-fstrim-metrics.service"): "/etc/systemd/system/setup-fstrim-metrics.service",
    Label("monitoring/guestos/nft-exporter/nft-exporter.service"): "/etc/systemd/system/nft-exporter.service",
    Label("monitoring/guestos/nft-exporter/nft-exporter.timer"): "/etc/systemd/system/nft-exporter.timer",
    Label("monitoring/guestos/custom-metrics.sh"): "/opt/ic/bin/custom-metrics.sh",
    Label("monitoring/guestos/custom-metrics.service"): "/etc/systemd/system/custom-metrics.service",
    Label("monitoring/guestos/boot-metrics/boot-metrics.sh"): "/opt/ic/bin/boot-metrics.sh",
    Label("monitoring/guestos/boot-metrics/boot-metrics.service"): "/etc/systemd/system/boot-metrics.service",
    Label("monitoring/guestos/boot-metrics/boot-metrics.timer"): "/etc/systemd/system/boot-metrics.timer",
    Label("monitoring/guestos/boot-logging/log-boot-failure.service"): "/etc/systemd/system/log-boot-failure.service",
    Label("monitoring/guestos/boot-logging/log-boot-success.service"): "/etc/systemd/system/log-boot-success.service",
    Label("monitoring/guestos/metrics_tool.service"): "/etc/systemd/system/metrics_tool.service",
    Label("monitoring/guestos/metrics_tool.timer"): "/etc/systemd/system/metrics_tool.timer",
    Label("monitoring/node_exporter/node_exporter.crt"): "/etc/node_exporter/node_exporter.crt",
    Label("monitoring/node_exporter/node_exporter.key"): "/etc/node_exporter/node_exporter.key",
    Label("monitoring/node_exporter/web.yml"): "/etc/node_exporter/web.yml",
    Label("monitoring/node_exporter/node_exporter.service"): "/etc/systemd/system/node_exporter.service",
    Label("monitoring/node_exporter/node_exporter"): "/etc/default/node_exporter",
    Label("monitoring/node_exporter/setup-node_exporter-keys/setup-node_exporter-keys.sh"): "/opt/ic/bin/setup-node_exporter-keys.sh",
    Label("monitoring/node_exporter/setup-node_exporter-keys/setup-node_exporter-keys.service"): "/etc/systemd/system/setup-node_exporter-keys.service",
    Label("monitoring/metrics-proxy/guestos/metrics-proxy.yaml"): "/etc/metrics-proxy.yaml",
    Label("monitoring/metrics-proxy/metrics-proxy.service"): "/etc/systemd/system/metrics-proxy.service",
    Label("monitoring/journald.conf"): "/etc/systemd/journald.conf",
    Label("monitoring/grub-version/grub-version.sh"): "/opt/ic/bin/grub-version.sh",
    Label("monitoring/grub-version/grub-version.service"): "/etc/systemd/system/grub-version.service",

    # networking
    Label("networking/generate-network-config/generate-network-config-guestos.service"): "/etc/systemd/system/generate-network-config.service",
    Label("networking/nftables/reload_nftables.path"): "/etc/systemd/system/reload_nftables.path",
    Label("networking/nftables/reload_nftables.service"): "/etc/systemd/system/reload_nftables.service",
    Label("networking/nftables/nftables-empty.conf"): "/etc/nftables.conf",
    Label("networking/fallback.conf"): "/etc/systemd/resolved.conf.d/fallback.conf",
    Label("networking/resolv.conf"): "/etc/resolv.conf",
    Label("networking/network-tweaks.conf"): "/etc/sysctl.d/network-tweaks.conf",
    Label("networking/hosts"): "/etc/hosts",
    Label("networking/dev-certs/canister_http_test_ca.cert"): "/dev-certs/canister_http_test_ca.cert",
    Label("networking/socks-proxy/danted.service"): "/etc/systemd/system/danted.service",
    Label("networking/socks-proxy/danted.conf"): "/etc/danted.conf",

    # SELinux
    Label("guestos/selinux/dante/dante.fc"): "/prep/dante/dante.fc",
    Label("guestos/selinux/dante/dante.if"): "/prep/dante/dante.if",
    Label("guestos/selinux/dante/dante.te"): "/prep/dante/dante.te",
    Label("guestos/selinux/manageboot/manageboot.fc"): "/prep/manageboot/manageboot.fc",
    Label("guestos/selinux/manageboot/manageboot.if"): "/prep/manageboot/manageboot.if",
    Label("guestos/selinux/manageboot/manageboot.te"): "/prep/manageboot/manageboot.te",
    Label("guestos/selinux/fscontext-fixes/fscontext-fixes.fc"): "/prep/fscontext-fixes/fscontext-fixes.fc",
    Label("guestos/selinux/fscontext-fixes/fscontext-fixes.if"): "/prep/fscontext-fixes/fscontext-fixes.if",
    Label("guestos/selinux/fscontext-fixes/fscontext-fixes.te"): "/prep/fscontext-fixes/fscontext-fixes.te",
    Label("guestos/selinux/ic-node/ic-node.fc"): "/prep/ic-node/ic-node.fc",
    Label("guestos/selinux/ic-node/ic-node.if"): "/prep/ic-node/ic-node.if",
    Label("guestos/selinux/ic-node/ic-node.te"): "/prep/ic-node/ic-node.te",
    Label("guestos/selinux/infogetty/infogetty.fc"): "/prep/infogetty/infogetty.fc",
    Label("guestos/selinux/infogetty/infogetty.te"): "/prep/infogetty/infogetty.te",
    Label("guestos/selinux/misc-fixes/misc-fixes.if"): "/prep/misc-fixes/misc-fixes.if",
    Label("guestos/selinux/misc-fixes/misc-fixes.te"): "/prep/misc-fixes/misc-fixes.te",
    Label("guestos/selinux/node_exporter/node_exporter.fc"): "/prep/node_exporter/node_exporter.fc",
    Label("guestos/selinux/node_exporter/node_exporter.if"): "/prep/node_exporter/node_exporter.if",
    Label("guestos/selinux/node_exporter/node_exporter.te"): "/prep/node_exporter/node_exporter.te",
    Label("guestos/selinux/prep.sh"): "/prep/prep.sh",
    Label("guestos/selinux/setup-var/setup-var.if"): "/prep/setup-var/setup-var.if",
    Label("guestos/selinux/setup-var/setup-var.te"): "/prep/setup-var/setup-var.te",
    Label("guestos/selinux/systemd-fixes/systemd-fixes.if"): "/prep/systemd-fixes/systemd-fixes.if",
    Label("guestos/selinux/systemd-fixes/systemd-fixes.te"): "/prep/systemd-fixes/systemd-fixes.te",

    # ssh
    Label("ssh/provision-ssh-keys.sh"): "/opt/ic/bin/provision-ssh-keys.sh",
    Label("ssh/generate-host-ssh-keys/generate-host-ssh-keys.sh"): "/opt/ic/bin/generate-host-ssh-keys.sh",
    Label("ssh/generate-host-ssh-keys/generate-host-ssh-keys.service"): "/etc/systemd/system/generate-host-ssh-keys.service",
    Label("ssh/setup-ssh-user-keys/setup-ssh-user-keys-guestos.sh"): "/opt/ic/bin/setup-ssh-user-keys.sh",
    Label("ssh/setup-ssh-user-keys/setup-ssh-user-keys.service"): "/etc/systemd/system/setup-ssh-user-keys.service",
    Label("ssh/read-ssh-keys.sh"): "/opt/ic/bin/read-ssh-keys.sh",

    # upgrade
    Label("upgrade/shared-resources/monitor-expand-shared-data/monitor-expand-shared-data.service"): "/etc/systemd/system/monitor-expand-shared-data.service",
    Label("upgrade/shared-resources/upgrade-shared-data-store/upgrade-shared-data-store.sh"): "/opt/ic/bin/upgrade-shared-data-store.sh",
    Label("upgrade/shared-resources/upgrade-shared-data-store/upgrade-shared-data-store.service"): "/etc/systemd/system/upgrade-shared-data-store.service",
    Label("upgrade/shared-resources/setup-shared-resources/setup-shared-backup.sh"): "/opt/ic/bin/setup-shared-backup.sh",
    Label("upgrade/shared-resources/setup-shared-resources/setup-shared-backup.service"): "/etc/systemd/system/setup-shared-backup.service",
    Label("upgrade/shared-resources/setup-shared-resources/setup-shared-crypto.sh"): "/opt/ic/bin/setup-shared-crypto.sh",
    Label("upgrade/shared-resources/setup-shared-resources/setup-shared-crypto.service"): "/etc/systemd/system/setup-shared-crypto.service",
    Label("upgrade/shared-resources/setup-shared-resources/setup-shared-data.sh"): "/opt/ic/bin/setup-shared-data.sh",
    Label("upgrade/shared-resources/setup-shared-resources/setup-shared-data.service"): "/etc/systemd/system/setup-shared-data.service",
    Label("upgrade/shared-resources/setup-shared-resources/setup-shared-swap.sh"): "/opt/ic/bin/setup-shared-swap.sh",
    Label("upgrade/shared-resources/setup-shared-resources/setup-shared-swap.service"): "/etc/systemd/system/setup-shared-swap.service",
    Label("upgrade/shared-resources/setup-shared-resources/tmp.mount.d/override.conf"): "/etc/systemd/system/tmp.mount.d/override.conf",
    Label("upgrade/systemd-generators/guestos/mount-generator"): "/etc/systemd/system-generators/mount-generator",
    Label("upgrade/systemd-generators/systemd-gpt-auto-generator"): "/etc/systemd/system-generators/systemd-gpt-auto-generator",
    Label("upgrade/manageboot/manageboot.sh"): "/opt/ic/bin/manageboot.sh",
    Label("upgrade/shared-resources/monitor-expand-shared-data/monitor-expand-shared-data.py"): "/opt/ic/bin/monitor-expand-shared-data.py",
    Label("upgrade/grub.sh"): "/opt/ic/bin/grub.sh",
}
